package com.pfizer.Entity;

/**
 * QuestionOption--<b>問題選擇信息實體</b>--靜態變量為創建數據庫表需要的字段名
 * 
 * @author krui
 * @version 1.40 2011/11/19
 */
 
public class QuestionOption {
	private  	int ID;
	private	String Desc;
	private	boolean IsCorrect;
	public QuestionOption(String _ID,String _Desc,String _IsCorrect)
	{
		this.ID=new Integer(_ID).intValue();
		this.Desc=_Desc;
		if(_IsCorrect.equalsIgnoreCase("Y"))
		{
			this.IsCorrect=true;
		}
		else
		{
			this.IsCorrect=false;
		}
	}
	public QuestionOption()
	{
		
	}
	public QuestionOption(String _ID,String _IsCorrect)
	{
		this.ID=new Integer(_ID).intValue();
		if(_IsCorrect.equalsIgnoreCase("Y"))
		{
			this.IsCorrect=true;
		}
		else
		{
			this.IsCorrect=false;
		}
	}
	public void setID(String _ID)
	{
		this.ID=new Integer(_ID).intValue();
	}
	public void setID(int _ID)
	{
		this.ID=_ID;
	}
	public int getID()
	{
		return this.ID;
	}
	public void setDesc(String _Desc)
	{
		this.Desc=_Desc;
	}
	public String getDesc()
	{
		return this.Desc;
	}
	public void setIsCorrect(String _IsCorrect)
	{
		if(_IsCorrect.equalsIgnoreCase("y"))
		{
			this.IsCorrect=true;
		}
		else
		{
			this.IsCorrect=false;
		}
	}
	public boolean getIsCorrect()
	{
		return this.IsCorrect;
	}
	@Override
	public String toString() {
		// TODO Auto-generated method stub
		if(this.IsCorrect)
		{
			return String.valueOf(this.ID)+"|*|"+this.Desc+"|*|Y";
		}
		else
		{
			return String.valueOf(this.ID)+"|*|"+this.Desc+"|*|N";
		}
	}
}
